package com.april.pattern.structural.flyweight;

/**
 * @author April
 * @version V1.0.0
 * @date 2019/07/04 16:03
 * @description 享元的具体类
 */
public class ConcreteChessImpl implements ChessFlyWeight {
    private String color;

    public ConcreteChessImpl(String color) {
        this.color = color;
    }

    @Override
    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String getColor() {
        return this.color;
    }

    @Override
    public void display(Coordinate chess) {
        System.out.println("棋子颜色：" + color);
        System.out.println("棋子的位置：" + chess.getX() + "," + chess.getY());
    }
}
